﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TemplateUser.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="AirlineProject.Models"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $('#fromca').datepicker({
            minDate: 0,
            onSelect: function (selected) {
                $(".toca").datepicker("option", "minDate", selected)
            }
        });
        $('.keysearch').change(function () {
            var parentid = $('.keysearch option:selected').val();
            $.ajax({
                type: 'GET',
                url: 'Account/Search/' + parentid,
                success: function (data) {
                    $('.result').html(data);
                }
            });
        });
     });
</script>
    <div class="for_banners">
      <article class="col1">
        <div class="pad_bot3">
          <div class="box1">
            <h2 class="top">Search and Book Flights</h2>
            <% using (Html.BeginForm("SearchFlight", "Account", FormMethod.Post, new { id = "form_4" }))
                     { %> 
              <div>
                <div class="row"> <span class="left">From</span>
                  <select class="keysearch" name="from" style="width:20">
                            <%         
                       
                        AccountModels tk = new AccountModels();
                        List<Orgin> dsto = tk.ListOrg();
                        foreach (Orgin from in dsto)
                         {  
                    %>          
                                <option value="<%= from.orgin_id %>"> <%= from.place_name %></option>
                                       
                    <% } %>
                    </select>
                </div>
                <div class="row"> <span class="left">To</span>
                  <select class="result" name="to" style="width:20">
                      
                    <%
                            Destination des = new Destination();
                            des = (Destination)Session["des"]; 
                        AccountModels tkm = new AccountModels();
                        List<Destination> dsfrom = tkm.ListDes();
                        foreach (Destination to in dsfrom)
                         {  
                    %>
                                <option value="<%= to.destination_id %>"> <%= to.place_name %></option>     
                    <% } %>
                    </select> 
                </div>
                <div class="row"> <span class="left">Outbound</span>
                  <input type="text" id="fromca" class="input" value="<%= DateTime.Now.Date.ToShortDateString() %>" name="departure_date" />
                </div>
                <div class="row"> <span class="left">Adults</span>
                  <input type="text" class="input2" value="1"  onblur="if(this.value=='') this.value='1'" onFocus="if(this.value =='1' ) this.value=''">
                </div>
                <div class="row"> <span class="left">Children</span>
                  <input type="text" class="input2" value="0"  onblur="if(this.value=='') this.value='0'" onFocus="if(this.value =='0' ) this.value=''">
                  <span class="pad_left1">(0-11 years)</span> </div>
                <div class="wrapper"><input type="submit" value="Search" class="button1" /> <a href='<%= Url.Action("FlightSchedule","Home") %>' class="link1">Flight Shedule</a></div>
              </div>
            <% } %>
          </div>
        </div>
      </article>
      <div id="slider"> <img src="../../Content/user/images/banner1.jpg" alt=""> <img src="../../Content/user/images/banner2.jpg" alt=""> <img src="../../Content/user/images/banner3.jpg" alt=""> </div>
    </div>
    <div class="wrapper pad1">
      <article class="col1">
        <div class="box1">
          <h2 class="top">Offers of the Week</h2>
          <div class="pad"> <strong>Ho Chi Minh</strong><br>
            <ul class="pad_bot1 list1">
              <li> <span class="right color1">price: 200USD</span><a href="#">Phu Quoc</a></li>
              <li> <span class="right color1">price: 350USD</span><a href="#">Nha Trang</a></li>
              <li> <span class="right color1">price: 400USD</span><a href="#">Ca Mau</a></li>
            </ul>
            <strong>Ha Noi</strong><br>
            <ul class="pad_bot1 list1">
              <li> <span class="right color1">price: 350USD</span><a href="#">Nha Trang</a></li>
              <li> <span class="right color1">price: 400USD</span><a href="#">Ca Mau</a></li>
            </ul>
            <strong>Da Nang</strong><br>
            <ul class="pad_bot2 list1">
              <li> <span class="right color1">price: 200USD</span><a href="#">Hai Phong</a></li>
              <li> <span class="right color1">price: 500USD</span><a href="#">Noi Bai</a></li>
              <li> <span class="right color1">price: 700USD</span><a href="#">Vinh</a></li>
            </ul>
          </div>
        </div>
      </article>
      <article class="col2">
        <h3>About Our Airlines</h3>
        <div class="wrapper">
          <article class="cols">
            <figure><img src="../../Content/user/images/page1_img1.jpg" alt="" class="pad_bot2"></figure>
          </article>
          <article class="cols pad_left1">
            <figure><img src="../../Content/user/images/page1_img2.jpg" alt="" class="pad_bot2"></figure>
          </article>
        </div>
        <a href="#" class="button1"><strong>Read More</strong></a> </article>
    </div>
</asp:Content>
